/******************************************************************************
/
/  Authors:
/           Ilan   Bar Magen 
/    		Shalev Mintz      066078189  shalevmi@t2  
/
/  Submition date: 9/7/2008
/
/  This file contains:
/
/
******************************************************************************/

#include "library1.h" 
#include "stadium.h" 


void* init(int S) 
	{ if (S <= 0) return NULL;
	  Stadium * DS = new Stadium(S); return (void*)DS; } 

StatusType newFan(void* DS, int id, int stand, int chair, int team) 
	{	if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->newFan(id, stand, chair, team); }

StatusType banFan(void* DS, int stand, int chair)
	{ if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->banFan(stand, chair); }

StatusType getChair(void* DS, int id, int * stand, int * chair)
	{ if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->getChair(id, stand, chair); }

StatusType getNumMaccabiFans(void* DS, int stand, int * numFans)
	{ if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->getNumMaccabiFans(stand, numFans); }

StatusType getNumHapoelFans(void* DS, int stand, int * numFans)
	{ if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->getNumHapoelFans(stand, numFans); }

StatusType getNumFreeChairs(void* DS, int stand, int chair, int * freeChairs)
   { if (DS == NULL) 
		{return FAILURE;}
     if (freeChairs == NULL) 
		{return FAILURE;}

	 else {return ((Stadium *)DS)->getNumFreeChairs(stand, chair, freeChairs);} }

StatusType separateStands(void* DS, int stand1, int stand2)
	{ if (DS == NULL) return FAILURE;
		else return ((Stadium *)DS)->separateStands(stand1, stand2); }

int isImplementingBonus(void* DS)
	{if (DS == NULL) return FAILURE;
		else return 0;}

void quit(void* DS)
{if (DS != NULL) delete ((Stadium *)DS); 
return;}

